def add(a,b):
    r = a+b
    return r

def mul(a,v):
    r = a*v
    return r


def begin_end(old):
    """
        用来对其他函数进行扩展
    :param old: 要扩展的函数
    :return:
    """
    def new_function(*args,**kwargs):
        print("开始执行")
        # r = old(*args,**kwargs)
        old(*args, **kwargs)
        print(old.__doc__)
        print("结束执行")
    return new_function


# new_function = begin_end(mul)
# print(new_function(1,2))



@begin_end
def say_hello():
    """
    111
    12
    """
    say_hello.__doc__ = "222"
    print("1",say_hello.__doc__)
say_hello()